#ifndef __OLED_H
#define __OLED_H
#include <REGF51RC.H>
#include "i2c.h"

#define OLED_CMD 0 // 写命令
#define OLED_DATA 1 // 写数据

// OLED模式设置
// 0:4线串行模式
// 1:并行8080模式

#define SIZE 16
#define XLevelL 0x02
#define XLevelH 0x10
#define Max_Column 128
#define Max_Row 64
#define Brightness 0xFF
#define X_WIDTH 128
#define Y_WIDTH 64
//-----------------OLED端口定义----------------

void delay_ms(unsigned int ms);

// OLED控制用函数
void OLED_Display_On(void);
void OLED_Display_Off(void);
void OLED_Init(void);
void OLED_Clear(void);
void OLED_ShowChar(unsigned char x, unsigned char y, unsigned char chr);
void OLED_ShowString(unsigned char x, unsigned char y, unsigned char *p, unsigned char len);
void OLED_ShowInt(unsigned char x, unsigned char y, long num, unsigned char len);
void OLED_ShowUInt(unsigned char x, unsigned char y, long num, unsigned char len);
void OLED_Set_Pos(unsigned char x, unsigned char y);
void OLED_DrawBMP(unsigned char x0, unsigned char y0, unsigned char x1, unsigned char y1, unsigned char BMP[]);
void Delay_50ms(unsigned int Del_50ms);
void Delay_1ms(unsigned int Del_1ms);
void fill_picture(unsigned char fill_Data);

#endif
